import { $get, $post } from "@src/assets/js/request"

export async function getListRequest () {
  const res = await $get('/api/common/Chat')
  return res.data
}

export async function getDetailRequest (id) {
  const res = await $get(`/api/common/Chat/${id}`)
  return res.data
}

export async function sendRequest (title, lastid) {
  const d = {
    title: encodeURIComponent(title)
  }
  if (lastid !== '') {
    d.sessionid = lastid
  }
  const res = await $post('/api/common/Chat', d)
  return res.data
}